﻿#define _CRT_SECURE_NO_WARNINGS 1
#include "List.h"


void Test()
{
	LTNode* plist = NULL;
	LTInit(&plist);

	////测试尾插
	//LTPushBack(plist, 1);
	//LTPushBack(plist, 2);
	//LTPushBack(plist, 3);
	//LTPrint(plist);

	//测试头插
	LTPushFront(plist, 3);
	LTPushFront(plist, 2);
	LTPushFront(plist, 1);
	LTPrint(plist);

	////测试尾删
	//LTPopBack(plist);
	//LTPrint(plist);
	//LTPopBack(plist);
	//LTPrint(plist);
	//LTPopBack(plist);
	//LTPrint(plist);

	////测试头删
	//LTPopFront(plist);
	//LTPrint(plist);
	//LTPopFront(plist);
	//LTPrint(plist);
	//LTPopFront(plist);
	//LTPrint(plist);

	////测试查找
	//LTNode* find = LTFind(plist, 2);
	//if (find != NULL)
	//{
	//	printf("找到了%d\n",find->data);
	//}
	//else
	//{
	//	printf("没找到\n");
	//}

	////测试指定位置之后插⼊数据
	//LTNode* find = LTFind(plist, 2);
	//LTInsert(find, 9);
	//LTPrint(plist);

	////测试删除指定位置的数据
	//LTNode* find = LTFind(plist, 3);
	//LTErase(find);
	//find = NULL;
	//LTPrint(plist);

	//销毁
	LTDestroy(plist);
	plist = NULL;
}
int main()
{
	Test();
	return 0;
}